<template>
    <view v-if="show" class="popup-modal">
        <view class="mask" @tap="$emit('cancel')"></view>
        <slot></slot>
    </view>
</template>

<script>
export default {
    name: 'PopupModal',
    props: {
        show: {
            type: Boolean,
            default: false
        }
    }
}
</script>

<style lang="scss">
.popup-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
    
    .mask {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
    }
}
</style> 